package com.xjscrm.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 *
 */
@Getter
@AllArgsConstructor
public enum ChatConversationTypeEnum {

    prv_conversation(110, "私聊"),
    group_conversation(111, "群聊"),

    ;
    private final Integer code;
    private final String desc;

    public static ChatConversationTypeEnum getById(Integer id) {
        for (ChatConversationTypeEnum type : ChatConversationTypeEnum.values()) {
            if (Objects.equals(type.getCode(), id)) {
                return type;
            }
        }
        return null;
    }
}
